1. Field of the Invention
The present invention relates to a focus detection device used in cameras and in video equipment.
2. Description of Related Art
A focus detection device of a camera using a phase differential detection method is well known. FIG. 11 illustrates a focus detection device using a phase differential detection method. Light rays entering from region 101 in the shooting lens 100 pass through a field mask 200, a field lens 300, a stop aperture unit 401, and a re-imaging lens 501 and compose an image on an image sensor array A. The image sensor array is composed of a plurality of photoelectric conversion elements, arranged in a one-dimensional line, and produces an output corresponding to the light intensity. Similarly, light rays entering from region 102 in the shooting lens 100 pass through the field mask 200, the field lens 300, the stop aperture unit 402 and the re-imaging lens 502 and compose an image on the image sensor array B.
The two subject images thus composed on the image sensor arrays A, B, move away from each other during the so-called front focus condition in which the shooting lens 100 composes a clear image of the subject in front of the predetermined focus surface. Conversely, the images move toward each other during the so-called rear focus condition in which the shooting lens 100 composes a clear image of the subject in the back of the predetermined focus surface. The subject images on the image sensor arrays A, B, relatively coincide with each other during the so-called in-focus condition in which a clear image of the subject is composed on the predetermined focus surface. Therefore, focus adjustment of the shooting lens 100, in particular, and the amount and the direction of the deviation from the in-focus condition (hereafter simply defocus amount) in the present invention can be determined by obtaining the relative position shift of the pair of subject images as a result of the conversion of the pair of subject images into electric signals through photoelectric conversion using the signals produced by the image sensor arrays, and by algorithmic processing on these signals.
Thus, projected images from the re-imaging lenses 501 and 502 in the image sensor arrays A, B, coincide with each other in the vicinity of the predetermined focus surface, which, in general, is the central region in the shooting field as illustrated in FIG. 15. This region is designated as a focus detection area.
Here, the algorithm processing method for obtaining the defocus amount will be described.
Each of the image sensor arrays A, B, is composed of a plurality of photoelectric conversion elements and outputs a plurality of output signal strings a[1], . . . a[n] and b[1], . . . b[n] (see FIG. 13 (a), (b)). Subsequently, the image sensor arrays perform the correlation algorithm while relatively shifting the data within a specified range of the pair of output signal strings by a predetermined data amount L. Letting the maximum shift amount be 1 max, the range of L becomes -1 max to 1 max. Specifically, the correlation amount C[L] is computed using formula 1. EQU C[L]=.SIGMA..vertline.a[i+L]-b[i].vertline. (1)
L=-1 max, . . . -2, -1, 0, 1, 2, . . . 1 max
where .SIGMA. denotes the total sum over i=k.fwdarw.r.
In formula 1, L is an integer corresponding to the shift amount of the data strings as described above. The first term k and the last term r vary depending on the shift amount L as described formulae 2. EQU If L.gtoreq.0, . . . k=k0+INT{-L/2} EQU r=r0+INT{-L/2} EQU If L&lt;0, k=k0+INT{-(L+1)/2} EQU r=r0+INT{-(L+1)/2}, (2)
where k0 and r0 denote the first term and the last term, respectively, when the shift amount L is equal to 0.
FIG. 14 illustrates a combination of signals for computing the absolute value of the difference between array A signals and array B signals in formula 1 and the algorithm range resulting from adding the absolute values of these differences when the initial term k and the last term r are varied by formulae 2. As illustrated in the figure, the ranges used in the correlation algorithm of row A and row B shift away from each other with the change in the shift amount L. In a method in which the first term k and the last term r are fixed regardless of the shift amount L, the range used in the correlation algorithm of one of the rows is held constant, and only the other row shifts. In this case, the shift amount of the relative position becomes the shift amount L when a pair of data coincides. Therefore, the shift amount making the correlation amount a relative minimum among the correlation amounts C[L] thus obtained is detected. This shift amount is multiplied by a constant determined by the pitch width of the photoelectric conversion elements in the image sensor array and the optical system described in FIG. 11 to become the defocus amount. Thus, a large defocus amount can be detected by making the maximum shift value 1 max larger.
Here, the correlation amount C[L] is discrete, as illustrated in FIG. 13(c), and the minimum unit of detectable defocus amount is limited by the pitch width of the photoelectric conversion elements in the image sensor arrays A, B. A method in which precise focus detection is obtained by performing the interpolation algorithm based on the discrete correlation amount C[L] resulting in a new, true relative minimum Cex is disclosed by the applicant of the present invention in U.S. Pat. No. 4,561,749. In this method, a true relative minimum Cex and a shift amount Ls producing Cex are computed by formulae 3 and formula 4 using a relative minimum correlation amount C[1] and correlation amounts C[1+1] and C[1-1] with shift amounts on both sides of C[1], as illustrated in FIG. 12. EQU DL=(C[1-1]-C[1+1])/2 Cex=C[1]-.vertline.DL.vertline. (3) EQU E=MAX{C[1+1]-C[1], C[1-1]-C[1]} EQU Ls=1+DL/E (4)
In formulae 3, MAX{Ca, Cb} is the larger of Ca and Cb. Finally, the defocus amount DF is computed from the shift amount Ls using formula 5. EQU DF=Kf.times.Ls (5)
Kf in formula 5 is a constant determined by the photoelectric conversion elements in the optical system and in the image sensor array in FIG. 11.
For the defocus amount thus obtained, a determination must be made regarding whether it is a true defocus amount or whether it is caused by a fluctuation of correlation amounts due to noise and the like. If the defocus amount satisfies the conditions of formula 6, it is considered reliable. EQU E&gt;E1 and Cex/E&lt;G1 (6)
E1 and G1 in formula 6 are predetermined threshold values. Value E quantifies changes in the correlation amount that depend on the contrast of the subject, and, as the value of E becomes larger, the contrast becomes larger and the confidence level becomes higher. Cex is the difference between the pair of data when the data are closest to each other. Ideally, Cex should be 0. However, due to noise and the visual difference between region 101 and region 102, there is a minute difference between the pair of subject images; hence, Cex is never 0 in reality. As the contrast of the subject becomes higher, the effect of noise and the difference in subject images becomes smaller. Therefore, Cex/E is used to denote the level of coincidence of the pair of data. Naturally, as the value of Cex/E becomes closer to 0, the level of the coincidence of the pair of data and the level of confidence becomes higher.
In another method, the contrast for one of the pair of data is computed and used instead of the value E to determine confidence. If the system is determined reliable, driving or display of the shooting lens 100 is executed based on the defocus amount DF. The correlation algorithm, the interpolation algorithm and the determination of conditions associated with formula 1 through formula 6, above, will be referred to together as the focus detection algorithm.
In the above-stated description of the focus detection algorithm, the output signals from the image sensor array are used without modification. However, a method in which filter processing is executed on the output signals to compute the filter processing data, and the focus detection algorithm is performed using the filter processing data, is disclosed in Japanese Laid-Open Patent Publication Sho 61-245123.
If the shooting lens 100 is in the focus condition, the focus detection device is structured in general such that a pair of data coincide when the shift amount L is approximately 0. Therefore, the shooting lens 100 cannot focus on a subject unless the subject image is not formed in the range from the first term k0 through the last term r0 of the image sensor arrays A, B. Thus, the region in which focus detection is performed is determined by the first term k0 and the last term r0. Assuming, for example, that the first term k0 and the last term r0 are part of the central section of the image sensor array, the region in which focus detection is performed becomes the region described by the real line in the central section of the shooting field. Hereinafter, the data range from the first term k0 through the last term r0 will be called the algorithm range. Moreover, the region corresponding to the algorithm range on the shooting field is the focus detection area, and the photographer is able to focus the shooting lens on a desired subject by catching the subject within the focus detection area.
In the focus detection device described above, the optimum algorithm range varies with the subject pattern. This problem will be described with reference to FIGS. 7, 8 and 9. These figures show one of the output signals in the pair of image sensor arrays.
In comparing the wide algorithm range ce1 and the narrow algorithm range ce2 when the subject pattern consists only of low frequency components, as illustrated in FIG. 7, the wide algorithm range ce1 is found to have more contrasts contained in the algorithm range than the narrow range ce2. Thus, the value E for the wide algorithm range ce1 obtained by the focus detection algorithms using formulae 1 through 6 becomes larger, resulting in the focus detection in the algorithm range ce1 having a higher confidence level.
Moreover, in comparing the wide algorithm range ce1 and the narrow algorithm range ce2 when the subject pattern contains high frequency components with contrasts existing locally, as illustrated in FIG. 8, the contrasts contained in the algorithm range are the same for both algorithm ranges. Thus, the values E obtained by the focus detection algorithms using formulae 1 through 6 are equal for both algorithm ranges. However, the effects of noise and the like are larger on the wider algorithm range; thus, the value Cex becomes smaller for the narrower algorithm range, resulting in the focus detection in the algorithm range ce2 having a higher confidence level.
Moreover, in comparing the wide algorithm range ce1 and the narrow algorithm range ce2 when the subject pattern contains high frequency components and a fine pattern spreads throughout the subject, as described in FIG. 9, the wide algorithm range ce1 is found to have more contrasts contained in the algorithm range than the narrow range ce2. Thus, the value E for the wide algorithm range ce1 obtained by the focus detection algorithms using formulae 1 through 6 becomes larger, resulting in the focus detection in algorithm range ce1 having a higher confidence level.
In order to overcome the problem that the optimum algorithm range varies with the subject pattern, a method of focus detection in which the frequency component contained in the subject pattern is detected and the algorithm range is made narrower if a high frequency component is found, while the algorithm range is made wider if no high frequency component is found, is disclosed by the applicant of the present invention in Japanese Laid-Open Patent Publication Hei 4-211213. In this method, the optimum algorithm range is selected in the cases of FIG. 7 and FIG. 8. However, the method is ineffective in a situation in which a high frequency component is contained and the wide algorithm range is desired.
Moreover, the position of the pattern is shifted, as shown in FIG. 8, the output signal becomes similar to the signal shown in FIG. 10 and contrasts disappear from the narrow algorithm range ce2, thus making it impossible to obtain focus detection results with a high confidence level.